﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    mc:Ignorable="d">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Brushes.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!-- Global Defaults -->
    <Style TargetType="ButtonBase">
        <Setter Property="MinHeight"
                Value="24" />
        <Setter Property="MinWidth"
                Value="80" />
    </Style>

    <!-- Flat Button -->
    <Style x:Key="FlatButton"
           TargetType="ButtonBase">
        <Setter Property="Background"
                Value="{StaticResource FlatButtonHoverBackgroundBrush}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource FlatButtonHoverBorderBrush}" />
        <Setter Property="HorizontalContentAlignment"
                Value="Center" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="Padding"
                Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ButtonBase">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         Storyboard.TargetName="border"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="border"
                                Margin="0"
                                BorderThickness="1"
                                CornerRadius="2"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                Opacity="0" />
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          Margin="{TemplateBinding Padding}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- DockPane button style -->
    <Style x:Key="DockPaneButton"
           TargetType="ButtonBase"
           BasedOn="{StaticResource FlatButton}">
        <Setter Property="Background"
                Value="{StaticResource DockPaneHoverBackgroundBrush}" />
        <Setter Property="BorderBrush"
                Value="Transparent" />
    </Style>

</ResourceDictionary>